﻿// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace System.Mobile.Mvc
{
    public static class ViewFormExtension
    {
        public static ViewDataDictionary<TModel> GetViewData<TModel>(this IView<TModel> view) where TModel : class
        {
            if (view.ViewData == null)
            {
                view.ViewData = new ViewDataDictionary<TModel>();
            }
            return view.ViewData;
        }

        public static void SetViewData<TModel>(this IView<TModel> view, ViewDataDictionary<TModel> data) where TModel : class
        {
            view.ViewData = data;
        }
      
    }
}
